package com.test.lambda;

public class LambdaStaticDemo {
    public interface MyPrint {
        void myprint();
    }
    private static void doPrint(MyPrint myPrint) {
        myPrint.myprint();
    }

    public static void main(String[] args) {
        // lambda 表达式里，未引用类相关变量，每使用一次就生成一个类静态方法
        doPrint(() -> System.out.println("hello lambda"));
        doPrint(() -> System.out.println("hello lambda2"));
        doPrint(() -> System.out.println("hello lambda3"));
    }
}
